package com.itheima.commons.model.vo;

import cn.hutool.core.date.DateUtil;
import com.itheima.commons.model.domain.UserFreeze;
import com.itheima.commons.model.mongo.Publish;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

//日志详情
@Data
@NoArgsConstructor
@AllArgsConstructor
public class LogDetailsVo {
    private String operation;// 操作
    private String describe;// 描述
    private String operator;// 操作人
    private String ip;//  地址
    private String time;// 操作时间

    public LogDetailsVo(Publish publish, String adminName) {
        this.operation = "审核不通过";
        this.describe = "内容违规";
        this.operator = adminName;
        this.ip =  "198.168.12.1";
        this.time = DateUtil.date(publish.getOpsDatetime()).toString();
    }

    public LogDetailsVo(UserFreeze userFreeze, String adminName) {
        this.operation = "冻结";
        this.describe = userFreeze.getFreezeReason();
        this.operator = adminName;
        this.ip =  "198.168.12.13";
        this.time =  DateUtil.date(userFreeze.getFreezeStart()).toString();
    }
}
